package com.boot.controller;

import com.boot.DAO.UserPageDAO;
import com.boot.result.Result;
import com.boot.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin")
public class AdminController {

    @Autowired
    private UserService userService;

    @Operation(summary = "欢迎页")
    @GetMapping("hello")
    public String admin() {
        return "welcome admin";
    }

    @Operation(summary = "获取用户列表")
    @GetMapping("page")
    public Result pageUsers(UserPageDAO userPageDAO) {
        return userService.pageUsers(userPageDAO);

    }
}
